@import url('https://fonts.googleapis.com/css?family=ZCOOL+XiaoWei');


* {
	box-sizing: border-box;
}

body {
	background: #E9EED9;
	font-family: 'ZCOOL XiaoWei', serif;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100vh;
	margin: 0;
}

.container {
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	overflow: hidden;
	text-align: center;
	width: 280px;
	height: 170px;
}

.container h3 {
	color: #111;
	margin: 0 0 25px;
	position: relative;
	z-index: 2;
}

.checkbox-container {
	display: inline-block;
	position: relative;
}

.checkbox-container label {
	background-color: #aaa;
	border: 1px solid #fff;
	border-radius: 20px;
	display: inline-block;
	position: relative;
	transition: all 0.3s ease-out;
	width: 45px;
	height: 25px;
	z-index: 2;
}

.checkbox-container label::after {
	content: ' ';
	background-color: #fff;
	border-radius: 50%;
	position: absolute;
	top: 1.5px;
	left: 1px;
	transform: translateX(0);
	transition: transform 0.3s linear;
	width: 20px;
	height: 20px;
	z-index: 3;
}

.checkbox-container input {
	visibility: hidden;
	position: absolute;
	z-index: 2;
}

.checkbox-container input:checked + label + .active-circle {
	transform: translate(-50%, -50%) scale(15);
}

.checkbox-container input:checked + label::after {
	transform: translateX(calc(100% + 0.5px));
}

.active-circle {
	border-radius: 50%;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(calc(-50% - 10px), calc(-50% - 2px)) scale(0);
	transition: transform 0.6s ease-out;
	width: 30px;
	height: 30px;
	z-index: 1;
}

.checkbox-container.green .active-circle,
.checkbox-container.green input:checked + label {
	background-color: #CBD2A4;
}

.checkbox-container.yellow .active-circle,
.checkbox-container.yellow input:checked + label {
	background-color: #9A7E6F;
}

.checkbox-container.purple .active-circle,
.checkbox-container.purple input:checked + label {
	background-color: #54473F;
}


@media (max-width: 840px) {
	body {
		flex-direction: column;
	}
}

